
// import { hasRouteAuth } from '@/utils/permission';
// const isMediumUser = hasRouteAuth('crm:orderList:medium') && !hasRouteAuth('crm:orderList:admin');
// const isBrandUser = hasRouteAuth('crm:orderList:brand') && !hasRouteAuth('crm:orderList:admin');
// const isSaleUser = hasRouteAuth('crm:orderList:sale') && !hasRouteAuth('crm:orderList:admin');

// disabledMove: 禁止拖动   disableShow：禁止取消显示  fieldName: 字段名称
export const initOrderList = [
  { name: '订单类型', isShow: true, fieldName: 'orderType' },
  { name: '下单日期', isShow: true, fieldName: 'orderTime' },
  { name: '联系人', isShow: true, fieldName: 'contactPerson' },
  { name: '销售', isShow: true, fieldName: 'market' },
  { name: '客户名称', isShow: true, fieldName: 'clientName' },
  { name: '实际客户名称', isShow: true, fieldName: 'actualClientName' },
  { name: '所属集团', isShow: true, fieldName: 'group' },
  // { name: '供应商类型', isShow: true, parentField: 'orderInfo', fieldName: 'supplierType' },
  { name: '供应商类型', isShow: true, parentField: 'orderInfo', fieldName: 'supplierType' },
  { name: '收入类型', isShow: true, fieldName: 'incomeType' },
  { name: '所属部门', isShow: true, fieldName: 'attributionMatrix' },
  { name: '协作部门', isShow: false, parentField: 'orderInfo', fieldName: 'cooperationDepartment' }, // v2.1.5.3新增 time: 2020-08-26，协作部门暂时隐藏
  { name: '账号', isShow: true, fieldName: 'resourceName' },
  { name: '下单平台', isShow: true, fieldName: 'orderPlatform' },
  { name: '供应商', isShow: true, fieldName: 'cooperation' }, // 合作运营方，v2.9.3.1
  { name: '含税金额', isShow: true, fieldName: 'taxAmount' },
  { name: '品牌名称', isShow: true, fieldName: 'theme' },
  { name: '订单状态', isShow: true, fieldName: 'orderStatus' },
  { name: '核销状态', isShow: true, fieldName: 'writeOffStatus' },
  { name: '核销金额', isShow: true, fieldName: 'completeWriteOffAmount' },
  { name: '待核销金额', isShow: true, fieldName: 'unWriteOffAmount' },
  { name: '审批状态', isShow: false, fieldName: 'reviewState' },
  { name: '封账状态', isShow: false, fieldName: 'sealBillType' },
  // { name: '关联发票', isShow: true, fieldName: 'linkInvoice' },
  { name: '关联合同', isShow: true, fieldName: 'linkContract' },
  { name: '微任务成本状态', isShow: true, fieldName: 'microTaskCost' },
  { name: '成本状态', isShow: true, fieldName: 'totalCost' },
  { name: '付款申请', isShow: true, fieldName: 'supplierStatus' },
  { name: '客户结算状态', isShow: false, fieldName: 'settleStatus' },
  { name: '客户订单编号', isShow: false, fieldName: 'customerOrderNum' },
  { name: '是否开启采集', isShow: true, fieldName: 'autoPick' },

  // 以下为订单详情的字段 addTime: 2020-07-10
  // 订单信息
  { name: '订单编号', isShow: true, parentField: 'orderInfo', fieldName: 'orderId' },
  { name: '关联询单', isShow: true, parentField: 'orderInfo', fieldName: 'queryOrderSn' },
  { name: '客户ID', isShow: false, parentField: 'clientInfo', fieldName: 'clientId' },
  { name: '创建时间', isShow: false, parentField: 'orderInfo', fieldName: 'createTime' },
  { name: '客户类型', isShow: false, parentField: 'clientInfo', fieldName: 'clientType' },
  { name: '创建人', isShow: false, parentField: 'orderInfo', fieldName: 'createName' },
  { name: '到账日期', isShow: true, parentField: 'orderInfo', fieldName: 'accountTime' },
  { name: '刊例价', isShow: false, parentField: 'orderInfo', fieldName: 'articlesPrice' },
  { name: '折扣', isShow: false, parentField: 'orderInfo', fieldName: 'discountPrice' },
  { name: '渠道价', isShow: false, parentField: 'orderInfo', fieldName: 'channelPrice' },
  { name: '策划价', isShow: false, parentField: 'orderInfo', fieldName: 'planPrice' },
  { name: '成本小计', isShow: false, parentField: 'orderInfo', fieldName: 'cost' },
  { name: '核销时间', isShow: false, parentField: 'orderInfo', fieldName: 'writeOffTime' },
  { name: '业绩', isShow: false, parentField: 'orderInfo', fieldName: 'performance' },
  { name: '业绩月份', isShow: false, parentField: 'orderInfo', fieldName: 'performanceMonth' },
  { name: '策划执行人', isShow: false, parentField: 'clientInfo', fieldName: 'mastermind' },
  // { name: '订单分类', isShow: false, parentField: 'orderInfo', fieldName: 'orderKindName' },
  { name: '标签', isShow: false, parentField: 'orderInfo', fieldName: 'tag' },
  { name: '所有人员', isShow: false, parentField: 'orderInfo', fieldName: 'accountOperationList' },
  { name: '所属经营体', isShow: false, parentField: 'orderInfo', fieldName: 'resourceAttributionMatrix', tip: 'entityTip' },
  // 资源明细
  { name: '账号ID', isShow: false, parentField: 'orderInfo', fieldName: 'resourceCode' },
  { name: '系统ID', isShow: false, parentField: 'orderInfo', fieldName: 'resourceId' }, // v2.9.2
  { name: '运营模式', isShow: false, parentField: 'orderInfo', fieldName: 'operateModeName' }, // v2.9.2
  { name: '下单形式', isShow: false, parentField: 'orderInfo', fieldName: 'orderForm' },
  // { name: '账号归属', isShow: false, parentField: 'orderInfo', fieldName: 'accountBelongName' },
  { name: '执行人(商务侧)', isShow: false, parentField: 'orderInfo', fieldName: 'orderBusinessOperator' },
  { name: '执行人(资源侧)', isShow: false, parentField: 'orderInfo', fieldName: 'orderResourceOperator' },
  { name: '发布链接', isShow: false, parentField: 'orderInfo', fieldName: 'orderLink' },
  // { name: '终端品牌', isShow: false, parentField: 'orderInfo', fieldName: 'terminalType' },
  { name: '品牌标签', isShow: false, parentField: 'orderInfo', fieldName: 'needCategoryName' },
  { name: '发布文案', isShow: false, parentField: 'publishInfo', fieldName: 'publishRemark' },
  { name: '结算基数', isShow: false, parentField: 'orderInfo', fieldName: 'priceBase' },
  { name: '订单来源', isShow: false, parentField: 'orderInfo', fieldName: 'orderSource' },
  { name: '附件', isShow: false, parentField: 'orderInfo', fieldName: 'attachment' }, // v2.1.4 新增 20200722
  { name: '备注', isShow: false, parentField: 'orderInfo', fieldName: 'remark' },
  { name: '资源类型', isShow: true, parentField: 'orderInfo', fieldName: 'resourceType' }, // 热修复第二版新增
  // 成本明细

  { name: '达人成本', isShow: false, parentField: 'costBreakdown', fieldName: 'isAutoTalent' },
  { name: '成本确认', isShow: false, parentField: 'costBreakdown', fieldName: 'costConfirm' },
  { name: '成本项', isShow: true, fieldName: 'costNum' }
];
export const orderProps = {
  incomeType: { minWidth: '90', label: '收入类型', disableShow: false }, // 收入类型
  attributionMatrix: { minWidth: '110', label: '所属部门', disableShow: false }, // 所属部门
  resourceName: { minWidth: '180', label: '账号', disableShow: true }, // 账号
  orderPlatform: { minWidth: '110', label: '下单平台', disableShow: true }, // 下单平台
  cooperation: { minWidth: '110', label: '合作运营方', disableShow: false }, // 合作运营方 v2.9.3.1
  theme: { minWidth: '110', label: '品牌名称', disableShow: false }, // 推广主题
  orderStatus: { width: '84', label: '订单状态', disableShow: false },
  writeOffStatus: { minWidth: '100', label: '核销状态', disableShow: false }, // 核销状态
  autoPick: { minWidth: '120', label: '是否开启采集', disableShow: false },
  completeWriteOffAmount: { minWidth: '140', align: 'right', label: '核销金额(元)', disableShow: false, sortable: 'custom', prop: 'completeWriteOffAmount' }, // 核销金额 v3.2.4
  unWriteOffAmount: { minWidth: '140', align: 'right', label: '待核销金额(元)', disableShow: false, sortable: 'custom', prop: 'unWriteOffAmount' },
  reviewState: { width: '84', label: '审批状态', disableShow: false }, // 审批状态
  sealBillType: { width: '84', label: '封账状态', disableShow: false }, // 封账状态
  // linkInvoice: { width: '84', label: '关联发票', disableShow: false },
  linkContract: { width: '84', label: '关联合同', disableShow: false },
  microTaskCost: { width: '120', label: '微任务成本状态', disableShow: false },
  totalCost: { width: '84', label: '成本状态', disableShow: false },
  isAutoTalent: { minWidth: '130', label: '达人成本', disableShow: false },
  supplierStatus: { width: '120', label: '付款申请', disableShow: false },
  // 以下为订单详情的字段 addTime: 2020-07-10
  // 客户信息
  clientType: { width: '84', label: '客户类型', disableShow: false },
  clientId: { width: '84', label: '客户ID', disableShow: false },
  clientName: { minWidth: '220', label: '客户名称', disableShow: false, sortable: 'custom', prop: 'clientName' },
  actualClientName: { minWidth: '220', label: '实际客户名称', disableShow: false, sortable: 'custom', prop: 'actualClientName' },
  contactPerson: { minWidth: '100', label: '联系人', disableShow: false }, // 联系人
  market: { width: '85', label: '销售', disableShow: false }, // 销售
  mastermind: { width: '100', label: '策划执行人', disableShow: false },
  settleStatus: { width: '120', label: '客户结算状态', disableShow: false },
  customerOrderNum: { width: '120', label: '客户订单编号', disableShow: false },
  group: { width: '140', label: '所属集团', disableShow: false },
  // 订单信息
  orderTime: { width: '110', label: '下单日期', disableShow: false, sortable: 'custom', prop: 'orderTime' }, // 下单日期
  orderType: { width: '80', label: '订单类型', disableShow: false },
  articlesPrice: { minWidth: '120', label: '刊例价(元)', align: 'right', disableShow: false, sortable: 'custom', prop: 'publication_amount' },
  discountPrice: { minWidth: '90', label: '折扣', disableShow: false, sortable: 'custom', prop: 'discount' },
  taxAmount: { minWidth: '130', label: '含税金额(元)', align: 'right', disableShow: true, sortable: 'custom', prop: 'taxAmount' }, // 含税金额
  channelPrice: { minWidth: '120', label: '渠道价(元)', align: 'right', disableShow: false, sortable: 'custom', prop: 'channel_amount' }, // 渠道金额
  planPrice: { minWidth: '120', label: '策划价(元)', align: 'right', disableShow: false, sortable: 'custom', prop: 'plan_amount' }, // 策划金额
  tag: { minWidth: '110', label: '标签', align: 'left', disableShow: false },

  orderId: { minWidth: '120', label: '订单编号', disableShow: false },
  queryOrderSn: { minWidth: '135', label: '关联询单', disableShow: false },
  priceBase: { minWidth: '140', label: '结算基数(元)', align: 'right', disableShow: false, sortable: 'custom', prop: 'divided_into_base' }, // 结算基数
  orderSource: { minWidth: '120', label: '订单来源', disableShow: false }, // 订单来源
  cooperationDepartment: { minWidth: '120', label: '协作部门', disableShow: false },
  createTime: { minWidth: '110', label: '创建时间', disableShow: false, sortable: 'custom', prop: 'createTime' },
  createName: { minWidth: '90', label: '创建人', disableShow: false },
  accountTime: { minWidth: '110', label: '到账日期', disableShow: false, sortable: 'custom', prop: 'accountTime' },
  cost: { minWidth: '130', label: '成本小计(元)', align: 'right', disableShow: false },
  writeOffTime: { minWidth: '152', label: '核销时间', disableShow: false },
  performance: { width: '84', label: '业绩', disableShow: false, sortable: 'custom', prop: 'performance' },
  performanceMonth: { width: '84', label: '业绩月份', disableShow: false },
  orderBusinessOperator: { width: '120', label: '执行人(商务侧)', disableShow: false },
  orderResourceOperator: { width: '120', label: '执行人(资源侧)', disableShow: false },
  // orderKindName: { width: '110', label: '订单分类', disableShow: false },
  accountOperationList: { width: '110', label: '所有人员', disableShow: false },
  resourceAttributionMatrix: { width: '110', label: '所属经营体', disableShow: false },
  supplierType: { width: '110', label: '供应商类型', disableShow: false },
  // 资源明细
  resourceCode: { width: '100', label: '账号ID', disableShow: false },
  resourceId: { width: '100', label: '系统ID', disableShow: false },
  operateModeName: { minWidth: '250', label: '运营模式', disableShow: false },
  orderForm: { width: '100', label: '下单形式', disableShow: false },
  // accountBelongName: { minWidth: '110', label: '账号归属', disableShow: false },
  orderLink: { width: '84', label: '发布链接', disableShow: false },
  needCategoryName: { width: '90', label: '品牌标签', disableShow: false },
  publishRemark: { minWidth: '110', label: '发布文案', disableShow: false },
  remark: { minWidth: '110', label: '备注', disableShow: false },
  attachment: { minWidth: '100', label: '附件', disableShow: false }, // v2.1.4 新增 20200722
  resourceType: { width: '100', label: '资源类型', disableShow: true },

  // 成本明细
  costConfirm: { minWidth: '90', label: '成本确认', disableShow: false },
  costNum: { minWidth: '100', label: '成本项', disableShow: false }
};

/**
 * 财务流水列表
 */
export const initFinanceList = [
  { name: '到账日期', isShow: true, fieldName: 'arrivalTime' },
  { name: '交易单号', isShow: true, fieldName: 'transactionNumber' },
  { name: '收入金额', isShow: true, fieldName: 'incomeAmount' },
  { name: '可核销金额', isShow: true, fieldName: 'unWriteOffAmount' },
  { name: '付款人名称', isShow: true, fieldName: 'payName' },
  { name: '付款账号', isShow: true, fieldName: 'payNumber' },
  { name: '付款方式', isShow: true, fieldName: 'clientType' },
  { name: '核销状态', isShow: true, fieldName: 'verificationColor' },
  { name: '封账状态', isShow: true, fieldName: 'sealingState' },
  { name: '备注', isShow: true, fieldName: 'remark' },
  { name: '类型', isShow: true, fieldName: 'flowType' },
  { name: '订单编号', isShow: true, fieldName: 'orderSn' },
  { name: '流水单号', isShow: true, fieldName: 'flowNumber' },
  { name: '无需核销金额', isShow: true, fieldName: 'noWriteOffAmount' },
  { name: '关联发票金额', isShow: true, fieldName: 'relatedInvoiceAmount' },
  { name: '所属部门', isShow: true, fieldName: 'departmentName' },
  { name: '封账月份', isShow: true, fieldName: 'sealMonth' },
  { name: '创建人', isShow: true, fieldName: 'createName' },
  { name: '创建时间', isShow: true, fieldName: 'createTime' }
];
export const financeProps = {
  arrivalTime: { minWidth: '110', label: '到账日期', disableShow: true, prop: 'arrivalTime', sortable: 'custom' },
  transactionNumber: { minWidth: '120', label: '交易单号', disableShow: false },
  incomeAmount: { minWidth: '150', label: '收入金额(元)', align: 'right', disableShow: true, prop: 'incomeAmount', sortable: 'custom' },
  unWriteOffAmount: { width: '170', label: '可核销金额(元)', align: 'right', prop: 'unWriteOffAmount', sortable: 'custom' },
  payName: { minWidth: '220', label: '付款人名称', disableShow: true },
  payNumber: { width: '150', label: '付款账号', disableShow: false },
  clientType: { width: '110', label: '付款方式', disableShow: false },
  verificationColor: { minWidth: '100', label: '核销状态', disableShow: false },
  sealingState: { minWidth: '100', label: '封账状态', disableShow: false },
  remark: { width: '135', label: '备注', disableShow: false },
  flowType: { width: '80', label: '类型', disableShow: false },
  orderSn: { minWidth: '170', label: '订单编号', disableShow: false, prop: 'orderSn' },
  flowNumber: { minWidth: '170', label: '流水单号', disableShow: false, prop: 'flowNumber', sortable: 'custom' },
  noWriteOffAmount: { minWidth: '170', label: '无需核销金额(元)', align: 'right', disableShow: false, prop: 'noWriteOffAmount', sortable: 'custom' },
  relatedInvoiceAmount: { minWidth: '170', label: '关联发票金额(元)', align: 'right', disableShow: false, prop: 'relatedInvoiceAmount', sortable: 'custom' },
  departmentName: { width: '135', label: '所属部门', disableShow: false },
  sealMonth: { minWidth: '100', label: '封账月份', disableShow: false, prop: 'sealMonth', sortable: 'custom' },
  createName: { minWidth: '84', label: '创建人', disableShow: false },
  createTime: { minWidth: '165', label: '创建时间', disableShow: false, prop: 'createTime', sortable: 'custom' }
};
/**
 * 项目渠道单表
 */
export const initProjectOrderList = [
  { name: '订单编号', isShow: true, fieldName: 'orderId' },
  { name: '账号', isShow: true, fieldName: 'dataAccount' },
  { name: '含税金额(元)', isShow: true, fieldName: 'taxAmount' },
  { name: '含税成本(元)', isShow: true, fieldName: 'cost' },
  { name: '下单日期', isShow: true, fieldName: 'orderTime' },
  { name: '下单平台', isShow: true, fieldName: 'orderPlatform' },
  { name: '备注', isShow: true, fieldName: 'remark' },
  { name: '项目名称', isShow: true, fieldName: 'projectName' },
  { name: '项目类型', isShow: true, fieldName: 'projectTypeStr' },
  { name: '刊例价(元)', isShow: true, fieldName: 'articlesPrice' },
  { name: '折扣', isShow: true, fieldName: 'discountPrice' },
  { name: '所属部门', isShow: true, fieldName: 'attributionMatrixName' },
  { name: '收入类型', isShow: true, fieldName: 'incomeTypeStr' },
  { name: '下单形式', isShow: true, fieldName: 'orderForm' },
  { name: '账号ID', isShow: true, fieldName: 'resourceCode' },
  { name: '系统ID', isShow: true, fieldName: 'resourceId' },
  { name: '执行人(商务侧)', isShow: true, fieldName: 'orderBusinessOperator' },
  { name: '执行人(资源侧)', isShow: true, fieldName: 'orderResourceOperator' },
  { name: '协作部门', isShow: true, fieldName: 'cooperationDepartment' },
  { name: '所有人员', isShow: true, fieldName: 'accountOperationList' },
  { name: '标签', isShow: true, fieldName: 'tag' },
  { name: '所属经营体', isShow: true, fieldName: 'resourceAttributionMatrix' },
  { name: '合作运营方', isShow: true, fieldName: 'cooperation' },
  { name: '供应商类型', isShow: true, fieldName: 'supplierType' },
  { name: '品牌名称', isShow: true, fieldName: 'theme' },
  { name: '发布文案', isShow: true, fieldName: 'publishInfo' },
  { name: '发布链接', isShow: true, fieldName: 'orderLink' },
  { name: '销售', isShow: true, fieldName: 'clientInfo' },
  { name: '成本项', isShow: true, fieldName: 'costBreakdown' },
  { name: '创建人', isShow: true, fieldName: 'createName' },
  { name: '创建时间', isShow: true, fieldName: 'createTime' },
  { name: '客户名称', isShow: true, fieldName: 'clientName' },
  { name: '是否开启采集', isShow: true, fieldName: 'isPicked' },
  { name: '项目编号', isShow: true, fieldName: 'projectNum' }
];

export const projectOrderProps = {
  orderId: { label: '订单编号', disableShow: true, width: '110' },
  orderTime: { label: '下单日期', disableShow: false, width: '110', prop: 'order_create_date', sortable: 'custom' },
  projectName: { label: '项目名称', disableShow: false, width: '110' },
  projectTypeStr: { label: '项目类型', disableShow: false, width: '110', showType: 'normal' },
  remark: { label: '备注', disableShow: false, width: '110' },
  taxAmount: { label: '含税金额(元)', disableShow: false, width: '130', prop: 'tax_included_amount', sortable: 'custom' },
  cost: { label: '含税成本(元)', disableShow: false, width: '130', prop: 'cost', sortable: 'custom' },
  articlesPrice: { label: '刊例价(元)', disableShow: false, width: '120', prop: 'articles_price', sortable: 'custom' },
  discountPrice: { label: '折扣', disableShow: false, width: '110', showType: 'normal', prop: 'discount', sortable: 'custom' },
  attributionMatrixName: { label: '所属部门', disableShow: false, width: '110' },
  incomeTypeStr: { label: '收入类型', disableShow: false, width: '130' },
  orderPlatform: { label: '下单平台', disableShow: false, width: '130' },
  dataAccount: { label: '账号', disableShow: false, width: '140', prop: 'resource_name', sortable: 'custom' },
  orderForm: { label: '下单形式', disableShow: false, width: '110', showType: 'normal' },
  resourceCode: { label: '账号ID', disableShow: false, width: '110', showType: 'normal' },
  resourceId: { label: '系统ID', disableShow: false, width: '110', showType: 'normal' },
  orderBusinessOperator: { label: '执行人(商务侧)', disableShow: false, width: '120' },
  orderResourceOperator: { label: '执行人(资源侧)', disableShow: false, width: '120' },
  cooperationDepartment: { label: '协作部门', disableShow: false, width: '120' },
  accountOperationList: { label: '所有人员', disableShow: false, width: '150', showType: 'normal' },
  tag: { label: '标签', disableShow: false, width: '150' },
  resourceAttributionMatrix: { label: '所属经营体', disableShow: false, width: '150' },
  cooperation: { label: '合作运营方', disableShow: false, width: '200', showType: 'normal' },
  supplierType: { label: '供应商类型', disableShow: false, width: '200' },
  theme: { label: '品牌名称', disableShow: false, width: '110', prop: 'theme', sortable: 'custom', showType: 'normal' },
  publishInfo: { label: '发布文案', disableShow: false, width: '110' },
  orderLink: { label: '发布链接', disableShow: false, width: '110' },
  clientInfo: { label: '销售', disableShow: false, width: '110' },
  costBreakdown: { label: '成本项', disableShow: false, width: '110' },
  createName: { label: '创建人', disableShow: false, width: '110' },
  createTime: { label: '创建时间', disableShow: false, width: '150', prop: 'create_date', sortable: 'custom' },
  clientName: { label: '客户名称', isShow: true, fieldName: 'clientName' },
  isPicked: { label: '是否开启采集', isShow: true, fieldName: 'isPicked', minWidth: '120' },
  projectNum: { label: '项目编号', isShow: true, fieldName: 'projectNum', minWidth: '150' }
};
